package com.teach;

/**
 * <pre>
 * -
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-04-13 15:14
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 **/
public class RuntimeTest {

  public static void main(String[] args) {
//    Runtime runtime = new Runtime();//不能新建
    Runtime runtime = Runtime.getRuntime();//单例模式
    Student s = new Student("对象1");
    System.out.println("创建了:"+s);
    s = null;
    runtime.gc();//通知垃圾回收

    Student s1;
    for(int i=0;i<1000;i++){
      s1 = new Student("test"+i);
      System.out.println("创建了:"+s1);
      runtime.gc();
    }
  }
}
